var e = require("../@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var t = e(require("../service/index")), n = e(require("../config/baseUrl")), r = getApp(), a = function(e, n, r) {
    return new Promise(function(a, i) {
        t.default.get(e, n, r).then(function(e) {
            "0000" === e.code || "00000" === e.code ? a(e) : "32008" !== e.code && wx.showToast({
                icon: "none",
                title: e.msg,
                duration: 3e3
            }), i(e);
        }).catch(function(e) {
            i(e);
        });
    });
}, i = function(e, n, r) {
    return new Promise(function(a, i) {
        t.default.post(e, n, r).then(function(e) {
            "0000" === e.code || "00000" === e.code ? a(e) : "32008" !== e.code && wx.showToast({
                icon: "none",
                title: e.msg,
                duration: 3e3
            }), i(e);
        }).catch(function(e) {
            i(e);
        });
    });
}, o = {
    getUserInfo: function() {
        return a("/normal-activity-pdg/invite-present-red-packet/query-user-info?spread_id=".concat(r.globalData.spread_id, "&channel=").concat(r.globalData.aucChannel), {}, {
            baseUrl: n.default
        });
    },
    getUserInfo18: function() {
        return i("/promotion-act/invite-for-red-packet/user", {
            actionId: "inviteFor18",
            channel: r.globalData.aucChannel || "01-0379-aj67-9999",
            type: 3
        }, {
            baseUrl: n.default,
            contentType: "application/x-www-form-urlencoded"
        });
    },
    getRecordList: function(e, t) {
        return a("/normal-activity-pdg/invite-present-red-packet/query-invite-info", {
            page: e,
            status_type: t
        }, {
            baseUrl: n.default
        });
    },
    notice: function(e) {
        return a("/normal-activity-pdg/invite-present-red-packet/notify-invitee", {
            invite_info_seq: e
        }, {
            baseUrl: n.default
        });
    },
    getHongBao: function(e) {
        return a("/normal-activity-pdg/invite-present-red-packet/receive-red-packet", e ? {
            invite_info_seq: e
        } : {}, {
            baseUrl: n.default
        });
    },
    getHongBao18: function(e) {
        return i("/promotion-act/invite-for-red-packet/mina-receive-one", {
            seq: e,
            actionId: "inviteFor18"
        }, {
            baseUrl: n.default,
            contentType: "application/x-www-form-urlencoded"
        });
    },
    identify: function(e) {
        return a("/normal-activity-pdg/invite-present-red-packet/real-name-check", e, {
            baseUrl: n.default
        });
    },
    get100yuan: function() {
        return a("/normal-activity-pdg/invite-present-red-packet/receive-achieve-goal", {}, {
            baseUrl: n.default
        });
    },
    getPhoneNumber: function() {
        return Promise.reject();
    },
    getAvatar: function() {
        return a("/KCard/invitationHasGift/getInviteUrlAndInviteHistoryUrl");
    },
    getSucceedUser: function() {
        return a("/normal-activity-pdg/invite-present-red-packet/query-succeed-record");
    },
    getRealInfo: function() {
        return a("/normal-activity-pdg/invite-present-red-packet/query-real-name-info");
    },
    getSpreadUserInfo: function() {
        return a("/normal-activity-pdg/spread-plan/query-user-info", {}, {
            baseUrl: n.default
        });
    },
    getSpreadRecordList: function(e, t) {
        return a("/normal-activity-pdg/spread-plan/query-spread-info", {
            page: e,
            status_type: t
        }, {
            baseUrl: n.default
        });
    },
    getSpreadHongBao: function(e) {
        return a("/normal-activity-pdg/spread-plan/receive-red-packet", e ? {
            spread_info_seq: e
        } : {}, {
            baseUrl: n.default
        });
    },
    getScheme: function(e, t) {
        return i("/normal-activity-pdg/phone-recommend/generate-wx-mp-url-scheme", {
            path: e,
            query: t,
            expireDays: "10"
        }, {
            baseUrl: n.default,
            contentType: "\tapplication/x-www-form-urlencoded"
        });
    },
    getUserInfo_dl: function() {
        return a("/kcard-invitation/reach-volume-red-packet/user?channel=".concat(r.globalData.aucChannel), {}, {
            baseUrl: n.default
        });
    },
    getHF_dl: function(e) {
        return i("/kcard-invitation/reach-volume-red-packet/cash-out", e, {
            baseUrl: n.default,
            contentType: "application/x-www-form-urlencoded"
        });
    }
};

exports.default = o;